// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()

const db = cloud.database()
const _ = db.command

// 云函数入口函数
exports.main = async (event, context) => {
  return await db.collection('MYPLAY').add({
    data: {
      playid: event.playid,
      playtitle: event.playtitle,
      openid: event.openid,
      name: event.name,
      nickname: event.nickname,
      phone: event.phone,
      mail: event.mail,
      wechatno: event.wechatno,
      company: event.company,
      position: event.position,
      time:event.time,
      avatarUrl: event.avatarUrl,
      playdate: event.playdate,
      playtime: event.playtime,     
      playplace: event.playplace,
      playheadurl: event.playheadurl ,
      statu: '1'
    }
  })
}